State driven software systems are often used to interface an external entity (hardware or software) to a software system. The external entity communicates information to the software system by reporting its state. The software system maintains its own last known state for the entity. When a new state is received the current and new states are compared. If they are different it indicates that the entity changed states. This state change or transition causes the software system to take a specific action.
These systems are typically implemented using a state action table. This is a two dimensioned array. It is indexed by the software current state and the new state read from the entity. The result is a value that causes an action routine to be performed for that specific state transition. The number and complexity of the actions is a function of the number of states possible in the entity. An example of a system using this approach is the Sigma Tie Trunk Interface (TTI) manufactured by Rolm Systems, Inc., Santa Clara, Calif. In the TTI software only one large action routine was provided. It contained a CASE (statement in "C" programming language) statement that decodes the action to be performed based on the input from the state action table.
In some systems the states supported by the entity are not fully connected. For example, an entity in state X may legally change to state Y and Z but not to states A and B. This presents special problems for the software system. Various events (software restarts, communications errors or software/hardware faults) may cause entity state reports to be lost or corrupted. In this case the software system may be presented with a state transition that is not legal for that entity. In the TTI system illegal state transitions are ignored until a legal transition occurred.
When the software system is initialized some special processing is needed to insure that the software current state for the entity matches its actual state. This is typically done by setting the software current state to a pseudo state of RESTART/INITIALIZATION. The system then forces the entity to transmit its current state. A special state action table is provided to process this initial state transition. The TTI scanner uses a separate state action table on the first execution following a system restart or initialization.
Systems such as the TTI, and other such state driven software systems, may find use in many different applications where a central processing unit, for example, must interface with a plurality of peripherals, such as input/output devices that may be either local and/or remote to the central processing unit. One application is associated with telephone networks such as a PBX (Private Branch Exchange), and/or a CBX (Computerized Business Exchange). A CBX is a switching device typically used in a medium sized business for controlling the telephone system internal to the business. A CBX device provides the facility for answering a plurality of phones, interconnecting the associated phones to incoming calls or to selected ones of the internal phones in the exchange, signalling various ones of the phones in the system, and monitoring usage of the associated telephones. A modern CBX typically includes a computer connected to a bus servicing a plurality of telephones, for sending data signals between the computer and the various telephones in accordance with some programmed format. In this example, the telephones are considered peripheral devices for the particular computer and associated software system. A CBX is an interrupt driven system, whereby upon receipt of a signal, typically an incoming telephone call, software driven hardware senses an incoming call, and sets an interrupt flag which is driven onto the bus, for typically alerting a particular peripheral (telephone set in this example) that there is a call to pick up. Sophisticated ones of such systems may be programmed for leaving a message on a particular telephone peripheral device that a call was received at a particular time from a certain individual or number, and was unanswered. If the call is answered, the CBX acts to interconnect the calling signal with the appropriate peripheral telephone. As would be known to one of skill in the art, there are many other functions that may be provided in a computerized business exchange for use with telephones, or other such peripheral devices.
In known computerized business exchanges or CBX's, the system responds to an incoming signal such as a telephone call, by determining the software required for enabling a particular card or logic network associated with the desired peripheral system, for insuring that a particular action is carried out. The CBX monitors the particular card or logic network for a feedback signal or indication that the card has responded. In such prior systems, if a fault occurs causing the system to become hung up through cyclic repetition of a particular function that for some reason cannot be completed, prior systems may require an extraordinary amount of time to recover from such a fault mode, or may even cause the entire system to crash. In the event of such faults or crashes, an entire system, such as a telephone system, may become completely inoperative.